<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<title>雨水雨量实时监测系统</title>
		<link rel="stylesheet" type="text/css" th:href="@{/layui-v2.6.8/layui/css/layui.css}"/>
		<script th:src="@{/js/jquery.min.js}"></script>
		<script th:src="@{/layui-v2.6.8/layui/layui.js}"></script>
		<script th:src="@{/js/echarts.min.js}"></script>
		<style>
			body{
				/*background-color: #e2e2e2;*/
				background-image: url("/img/index.jpg");
			}
			.div_main{
				background-color: #F0F0F0;
				height: 750px;
			}
			.div_main_table{
				height: 600px;
			}
		</style>
	</head>
	<body>
	<div>
		<ul class="layui-nav layui-bg-blue" lay-bar="disabled">
			<li class="layui-nav-item"><a href="/rainwater/page/index">首页</a></li>
			<li class="layui-nav-item"><a href="/rainwater/page/show">实时显示</a></li>
			<li class="layui-nav-item "><a href="/rainwater/page/analysis">数据分析</a></li>
			<li class="layui-nav-item layui-this"><a href="/rainwater/page/point">测点管理</a></li>
			<li class="layui-nav-item"><a href="/rainwater/page/user">用户管理</a></li>
			<li class="layui-nav-item">
				<a th:href="@{/rainwater/page/individual}"><img src="//t.cn/RCzsdCq" class="layui-nav-img">用户</a>
			</li>
		</ul>
	</div>
	<div class="layui-container div_main" >
		<br>
		<div class="layui-row">
			<form class="layui-form" th:action="@{/rainwater/page/point/search}" method="post" accept-charset="UTF-8">
				<div class="layui-col-md5">
					<div class="layui-form-item">
						<label class="layui-form-label">搜索</label>
						<div class="layui-input-block ">
							<input type="text" name="search" required  lay-verify="required" placeholder="请输入名字或地址" autocomplete="off" class="layui-input">
						</div>
					</div>
				</div>
				<div class="layui-col-md2">
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
						</div>
					</div>
				</div>
			</form>
		</div>
		<hr class="layui-border-green">
		<div class="div_main_table">
			<table class="layui-table">
				<colgroup>
					<col width="150">
					<col width="200">
					<col>
				</colgroup>
				<thead>
				<tr>
					<th>序号</th>
					<th>测点名字</th>
					<th>地址（省、市、区）</th>
					<th>操作</th>
				</tr>
				</thead>
				<tbody th:each="point,num:${points}">
				<tr>
					<td th:text="${num.count}">1</td>
					<td th:text="${point.name}">name</td>
					<td th:text="${point.address}">人生就像是一场修行</td>
					<td>
						<a th:href="@{'/rainwater/page/point/select?id='+${point.getId()}}" class="layui-btn layui-btn-primary">详情</a>
						<button th:onclick="'deletePoint('+${point.getId()}+')'" class="layui-btn layui-btn-danger">删除</button>
					</td>
				</tr>
				</tbody>
			</table>
		</div>
		<hr class="layui-border-green">
		<div class="layui-row">
			<div class="layui-col-md2 layui-col-md-offset10">
				<div class="layui-col-md4">
					<a th:href="@{'/rainwater/page/point?pageNumber='+${upPage}+'&search='+${search}}" class="layui-btn layui-btn-sm">上一页</a>
				</div>
				<div class="layui-col-md4">
					<a th:href="@{'/rainwater/page/point?pageNumber='+${downPage}+'&search='+${search}}" class="layui-btn layui-btn-sm">下一页</a>
				</div>
			</div>
		</div>
	</div>
	</body>
</html>
<script>
	function deletePoint(id){
		let success = confirm("是否确定删除");
		if (success){
			window.location.href = "/rainwater/page/point/delete?id="+id
		}else{
			// console.log("no");
		}
	}
</script>